//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS ConnectCampaigns service.
///
/// Provide APIs to create and manage Amazon Connect Campaigns.
public struct ConnectCampaigns: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the ConnectCampaigns client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            serviceName: "ConnectCampaigns",
            serviceIdentifier: "connect-campaigns",
            serviceProtocol: .restjson,
            apiVersion: "2021-01-30",
            endpoint: endpoint,
            variantEndpoints: Self.variantEndpoints,
            errorType: ConnectCampaignsErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }




    /// FIPS and dualstack endpoints
    static var variantEndpoints: [EndpointVariantType: AWSServiceConfig.EndpointVariant] {[
        [.fips]: .init(endpoints: [
            "us-east-1": "connect-campaigns-fips.us-east-1.amazonaws.com",
            "us-west-2": "connect-campaigns-fips.us-west-2.amazonaws.com"
        ])
    ]}

    // MARK: API Calls

    /// Creates a campaign for the specified Amazon Connect account. This API is idempotent.
    @Sendable
    @inlinable
    public func createCampaign(_ input: CreateCampaignRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateCampaignResponse {
        try await self.client.execute(
            operation: "CreateCampaign", 
            path: "/campaigns", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a campaign for the specified Amazon Connect account. This API is idempotent.
    ///
    /// Parameters:
    ///   - connectInstanceId: 
    ///   - dialerConfig: 
    ///   - name: 
    ///   - outboundCallConfig: 
    ///   - tags: 
    ///   - logger: Logger use during operation
    @inlinable
    public func createCampaign(
        connectInstanceId: String,
        dialerConfig: DialerConfig,
        name: String,
        outboundCallConfig: OutboundCallConfig,
        tags: [String: String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateCampaignResponse {
        let input = CreateCampaignRequest(
            connectInstanceId: connectInstanceId, 
            dialerConfig: dialerConfig, 
            name: name, 
            outboundCallConfig: outboundCallConfig, 
            tags: tags
        )
        return try await self.createCampaign(input, logger: logger)
    }

    /// Deletes a campaign from the specified Amazon Connect account.
    @Sendable
    @inlinable
    public func deleteCampaign(_ input: DeleteCampaignRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "DeleteCampaign", 
            path: "/campaigns/{id}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes a campaign from the specified Amazon Connect account.
    ///
    /// Parameters:
    ///   - id: 
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteCampaign(
        id: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = DeleteCampaignRequest(
            id: id
        )
        return try await self.deleteCampaign(input, logger: logger)
    }

    /// Deletes a connect instance config from the specified AWS account.
    @Sendable
    @inlinable
    public func deleteConnectInstanceConfig(_ input: DeleteConnectInstanceConfigRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "DeleteConnectInstanceConfig", 
            path: "/connect-instance/{connectInstanceId}/config", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes a connect instance config from the specified AWS account.
    ///
    /// Parameters:
    ///   - connectInstanceId: 
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteConnectInstanceConfig(
        connectInstanceId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = DeleteConnectInstanceConfigRequest(
            connectInstanceId: connectInstanceId
        )
        return try await self.deleteConnectInstanceConfig(input, logger: logger)
    }

    /// Delete the Connect Campaigns onboarding job for the specified Amazon Connect instance.
    @Sendable
    @inlinable
    public func deleteInstanceOnboardingJob(_ input: DeleteInstanceOnboardingJobRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "DeleteInstanceOnboardingJob", 
            path: "/connect-instance/{connectInstanceId}/onboarding", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Delete the Connect Campaigns onboarding job for the specified Amazon Connect instance.
    ///
    /// Parameters:
    ///   - connectInstanceId: 
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteInstanceOnboardingJob(
        connectInstanceId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = DeleteInstanceOnboardingJobRequest(
            connectInstanceId: connectInstanceId
        )
        return try await self.deleteInstanceOnboardingJob(input, logger: logger)
    }

    /// Describes the specific campaign.
    @Sendable
    @inlinable
    public func describeCampaign(_ input: DescribeCampaignRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeCampaignResponse {
        try await self.client.execute(
            operation: "DescribeCampaign", 
            path: "/campaigns/{id}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Describes the specific campaign.
    ///
    /// Parameters:
    ///   - id: 
    ///   - logger: Logger use during operation
    @inlinable
    public func describeCampaign(
        id: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeCampaignResponse {
        let input = DescribeCampaignRequest(
            id: id
        )
        return try await self.describeCampaign(input, logger: logger)
    }

    /// Get state of a campaign for the specified Amazon Connect account.
    @Sendable
    @inlinable
    public func getCampaignState(_ input: GetCampaignStateRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetCampaignStateResponse {
        try await self.client.execute(
            operation: "GetCampaignState", 
            path: "/campaigns/{id}/state", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Get state of a campaign for the specified Amazon Connect account.
    ///
    /// Parameters:
    ///   - id: 
    ///   - logger: Logger use during operation
    @inlinable
    public func getCampaignState(
        id: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetCampaignStateResponse {
        let input = GetCampaignStateRequest(
            id: id
        )
        return try await self.getCampaignState(input, logger: logger)
    }

    /// Get state of campaigns for the specified Amazon Connect account.
    @Sendable
    @inlinable
    public func getCampaignStateBatch(_ input: GetCampaignStateBatchRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetCampaignStateBatchResponse {
        try await self.client.execute(
            operation: "GetCampaignStateBatch", 
            path: "/campaigns-state", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Get state of campaigns for the specified Amazon Connect account.
    ///
    /// Parameters:
    ///   - campaignIds: 
    ///   - logger: Logger use during operation
    @inlinable
    public func getCampaignStateBatch(
        campaignIds: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetCampaignStateBatchResponse {
        let input = GetCampaignStateBatchRequest(
            campaignIds: campaignIds
        )
        return try await self.getCampaignStateBatch(input, logger: logger)
    }

    /// Get the specific Connect instance config.
    @Sendable
    @inlinable
    public func getConnectInstanceConfig(_ input: GetConnectInstanceConfigRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetConnectInstanceConfigResponse {
        try await self.client.execute(
            operation: "GetConnectInstanceConfig", 
            path: "/connect-instance/{connectInstanceId}/config", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Get the specific Connect instance config.
    ///
    /// Parameters:
    ///   - connectInstanceId: 
    ///   - logger: Logger use during operation
    @inlinable
    public func getConnectInstanceConfig(
        connectInstanceId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetConnectInstanceConfigResponse {
        let input = GetConnectInstanceConfigRequest(
            connectInstanceId: connectInstanceId
        )
        return try await self.getConnectInstanceConfig(input, logger: logger)
    }

    /// Get the specific instance onboarding job status.
    @Sendable
    @inlinable
    public func getInstanceOnboardingJobStatus(_ input: GetInstanceOnboardingJobStatusRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetInstanceOnboardingJobStatusResponse {
        try await self.client.execute(
            operation: "GetInstanceOnboardingJobStatus", 
            path: "/connect-instance/{connectInstanceId}/onboarding", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Get the specific instance onboarding job status.
    ///
    /// Parameters:
    ///   - connectInstanceId: 
    ///   - logger: Logger use during operation
    @inlinable
    public func getInstanceOnboardingJobStatus(
        connectInstanceId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetInstanceOnboardingJobStatusResponse {
        let input = GetInstanceOnboardingJobStatusRequest(
            connectInstanceId: connectInstanceId
        )
        return try await self.getInstanceOnboardingJobStatus(input, logger: logger)
    }

    /// Provides summary information about the campaigns under the specified Amazon Connect account.
    @Sendable
    @inlinable
    public func listCampaigns(_ input: ListCampaignsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListCampaignsResponse {
        try await self.client.execute(
            operation: "ListCampaigns", 
            path: "/campaigns-summary", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Provides summary information about the campaigns under the specified Amazon Connect account.
    ///
    /// Parameters:
    ///   - filters: 
    ///   - maxResults: 
    ///   - nextToken: 
    ///   - logger: Logger use during operation
    @inlinable
    public func listCampaigns(
        filters: CampaignFilters? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListCampaignsResponse {
        let input = ListCampaignsRequest(
            filters: filters, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listCampaigns(input, logger: logger)
    }

    /// List tags for a resource.
    @Sendable
    @inlinable
    public func listTagsForResource(_ input: ListTagsForResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTagsForResourceResponse {
        try await self.client.execute(
            operation: "ListTagsForResource", 
            path: "/tags/{arn}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// List tags for a resource.
    ///
    /// Parameters:
    ///   - arn: 
    ///   - logger: Logger use during operation
    @inlinable
    public func listTagsForResource(
        arn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTagsForResourceResponse {
        let input = ListTagsForResourceRequest(
            arn: arn
        )
        return try await self.listTagsForResource(input, logger: logger)
    }

    /// Pauses a campaign for the specified Amazon Connect account.
    @Sendable
    @inlinable
    public func pauseCampaign(_ input: PauseCampaignRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "PauseCampaign", 
            path: "/campaigns/{id}/pause", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Pauses a campaign for the specified Amazon Connect account.
    ///
    /// Parameters:
    ///   - id: 
    ///   - logger: Logger use during operation
    @inlinable
    public func pauseCampaign(
        id: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = PauseCampaignRequest(
            id: id
        )
        return try await self.pauseCampaign(input, logger: logger)
    }

    /// Creates dials requests for the specified campaign Amazon Connect account. This API is idempotent.
    @Sendable
    @inlinable
    public func putDialRequestBatch(_ input: PutDialRequestBatchRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> PutDialRequestBatchResponse {
        try await self.client.execute(
            operation: "PutDialRequestBatch", 
            path: "/campaigns/{id}/dial-requests", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates dials requests for the specified campaign Amazon Connect account. This API is idempotent.
    ///
    /// Parameters:
    ///   - dialRequests: 
    ///   - id: 
    ///   - logger: Logger use during operation
    @inlinable
    public func putDialRequestBatch(
        dialRequests: [DialRequest],
        id: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> PutDialRequestBatchResponse {
        let input = PutDialRequestBatchRequest(
            dialRequests: dialRequests, 
            id: id
        )
        return try await self.putDialRequestBatch(input, logger: logger)
    }

    /// Stops a campaign for the specified Amazon Connect account.
    @Sendable
    @inlinable
    public func resumeCampaign(_ input: ResumeCampaignRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "ResumeCampaign", 
            path: "/campaigns/{id}/resume", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Stops a campaign for the specified Amazon Connect account.
    ///
    /// Parameters:
    ///   - id: 
    ///   - logger: Logger use during operation
    @inlinable
    public func resumeCampaign(
        id: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = ResumeCampaignRequest(
            id: id
        )
        return try await self.resumeCampaign(input, logger: logger)
    }

    /// Starts a campaign for the specified Amazon Connect account.
    @Sendable
    @inlinable
    public func startCampaign(_ input: StartCampaignRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "StartCampaign", 
            path: "/campaigns/{id}/start", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Starts a campaign for the specified Amazon Connect account.
    ///
    /// Parameters:
    ///   - id: 
    ///   - logger: Logger use during operation
    @inlinable
    public func startCampaign(
        id: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = StartCampaignRequest(
            id: id
        )
        return try await self.startCampaign(input, logger: logger)
    }

    /// Onboard the specific Amazon Connect instance to Connect Campaigns.
    @Sendable
    @inlinable
    public func startInstanceOnboardingJob(_ input: StartInstanceOnboardingJobRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> StartInstanceOnboardingJobResponse {
        try await self.client.execute(
            operation: "StartInstanceOnboardingJob", 
            path: "/connect-instance/{connectInstanceId}/onboarding", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Onboard the specific Amazon Connect instance to Connect Campaigns.
    ///
    /// Parameters:
    ///   - connectInstanceId: 
    ///   - encryptionConfig: 
    ///   - logger: Logger use during operation
    @inlinable
    public func startInstanceOnboardingJob(
        connectInstanceId: String,
        encryptionConfig: EncryptionConfig,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StartInstanceOnboardingJobResponse {
        let input = StartInstanceOnboardingJobRequest(
            connectInstanceId: connectInstanceId, 
            encryptionConfig: encryptionConfig
        )
        return try await self.startInstanceOnboardingJob(input, logger: logger)
    }

    /// Stops a campaign for the specified Amazon Connect account.
    @Sendable
    @inlinable
    public func stopCampaign(_ input: StopCampaignRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "StopCampaign", 
            path: "/campaigns/{id}/stop", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Stops a campaign for the specified Amazon Connect account.
    ///
    /// Parameters:
    ///   - id: 
    ///   - logger: Logger use during operation
    @inlinable
    public func stopCampaign(
        id: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = StopCampaignRequest(
            id: id
        )
        return try await self.stopCampaign(input, logger: logger)
    }

    /// Tag a resource.
    @Sendable
    @inlinable
    public func tagResource(_ input: TagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "TagResource", 
            path: "/tags/{arn}", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Tag a resource.
    ///
    /// Parameters:
    ///   - arn: 
    ///   - tags: 
    ///   - logger: Logger use during operation
    @inlinable
    public func tagResource(
        arn: String,
        tags: [String: String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = TagResourceRequest(
            arn: arn, 
            tags: tags
        )
        return try await self.tagResource(input, logger: logger)
    }

    /// Untag a resource.
    @Sendable
    @inlinable
    public func untagResource(_ input: UntagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "UntagResource", 
            path: "/tags/{arn}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Untag a resource.
    ///
    /// Parameters:
    ///   - arn: 
    ///   - tagKeys: 
    ///   - logger: Logger use during operation
    @inlinable
    public func untagResource(
        arn: String,
        tagKeys: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = UntagResourceRequest(
            arn: arn, 
            tagKeys: tagKeys
        )
        return try await self.untagResource(input, logger: logger)
    }

    /// Updates the dialer config of a campaign. This API is idempotent.
    @Sendable
    @inlinable
    public func updateCampaignDialerConfig(_ input: UpdateCampaignDialerConfigRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "UpdateCampaignDialerConfig", 
            path: "/campaigns/{id}/dialer-config", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates the dialer config of a campaign. This API is idempotent.
    ///
    /// Parameters:
    ///   - dialerConfig: 
    ///   - id: 
    ///   - logger: Logger use during operation
    @inlinable
    public func updateCampaignDialerConfig(
        dialerConfig: DialerConfig,
        id: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = UpdateCampaignDialerConfigRequest(
            dialerConfig: dialerConfig, 
            id: id
        )
        return try await self.updateCampaignDialerConfig(input, logger: logger)
    }

    /// Updates the name of a campaign. This API is idempotent.
    @Sendable
    @inlinable
    public func updateCampaignName(_ input: UpdateCampaignNameRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "UpdateCampaignName", 
            path: "/campaigns/{id}/name", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates the name of a campaign. This API is idempotent.
    ///
    /// Parameters:
    ///   - id: 
    ///   - name: 
    ///   - logger: Logger use during operation
    @inlinable
    public func updateCampaignName(
        id: String,
        name: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = UpdateCampaignNameRequest(
            id: id, 
            name: name
        )
        return try await self.updateCampaignName(input, logger: logger)
    }

    /// Updates the outbound call config of a campaign. This API is idempotent.
    @Sendable
    @inlinable
    public func updateCampaignOutboundCallConfig(_ input: UpdateCampaignOutboundCallConfigRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "UpdateCampaignOutboundCallConfig", 
            path: "/campaigns/{id}/outbound-call-config", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates the outbound call config of a campaign. This API is idempotent.
    ///
    /// Parameters:
    ///   - answerMachineDetectionConfig: 
    ///   - connectContactFlowId: 
    ///   - connectSourcePhoneNumber: 
    ///   - id: 
    ///   - logger: Logger use during operation
    @inlinable
    public func updateCampaignOutboundCallConfig(
        answerMachineDetectionConfig: AnswerMachineDetectionConfig? = nil,
        connectContactFlowId: String? = nil,
        connectSourcePhoneNumber: String? = nil,
        id: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = UpdateCampaignOutboundCallConfigRequest(
            answerMachineDetectionConfig: answerMachineDetectionConfig, 
            connectContactFlowId: connectContactFlowId, 
            connectSourcePhoneNumber: connectSourcePhoneNumber, 
            id: id
        )
        return try await self.updateCampaignOutboundCallConfig(input, logger: logger)
    }
}

extension ConnectCampaigns {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: ConnectCampaigns, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension ConnectCampaigns {
    /// Return PaginatorSequence for operation ``listCampaigns(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listCampaignsPaginator(
        _ input: ListCampaignsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListCampaignsRequest, ListCampaignsResponse> {
        return .init(
            input: input,
            command: self.listCampaigns,
            inputKey: \ListCampaignsRequest.nextToken,
            outputKey: \ListCampaignsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listCampaigns(_:logger:)``.
    ///
    /// - Parameters:
    ///   - filters: 
    ///   - maxResults: 
    ///   - logger: Logger used for logging
    @inlinable
    public func listCampaignsPaginator(
        filters: CampaignFilters? = nil,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListCampaignsRequest, ListCampaignsResponse> {
        let input = ListCampaignsRequest(
            filters: filters, 
            maxResults: maxResults
        )
        return self.listCampaignsPaginator(input, logger: logger)
    }
}

extension ConnectCampaigns.ListCampaignsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> ConnectCampaigns.ListCampaignsRequest {
        return .init(
            filters: self.filters,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}
